﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace VisitorPattern.Samples;

internal class HtmlExportVisitor : IVisitorSample
{
    public void VisitImage(ImageElement imageElement)
    {
        Console.WriteLine($"<img src=\"{imageElement.Url}\">");
    }

    public void VisitPDF(PDFElement pdfElement)
    {
        Console.WriteLine($"PDF 文档 <strong>{pdfElement.PDFName}</strong>");
    }

    public void VisitTable(TableElement tableElement)
    {
        Console.WriteLine($"<table rows={tableElement.Rows} cols={tableElement.Columns} />");
    }

    public void VisitText(TextElement textElement)
    {
        Console.WriteLine($"<p>{textElement.Content}</p>");
    }
}
